import time
def metric(fn):
    def clock():
        time1=time.time()
        fn()
        time2=time.time()
        print('函数%s耗时：%.4fms'%(fn.__name__,(time2-time1)*1000))
    return clock
@metric
def a():
    for i in range(100):
        for j in range(100):
            for k in range(100):
                pass
a()







